If start_shell() threw an exception before, we'd overwrite it with
an exception in the finally() clause. Handle this and just print a message
and let the exception propagate.
normal_exit = False
try:
+ shell = None
if options.xephyr:
xephyr = start_xephyr()
# This makes us not grab the org.gnome.Panel name
except OSError:
pass
- if shell.returncode == 0:
+ if shell is None:
+ print "Failed to start shell"
+ elif shell.returncode == 0:
normal_exit = True
if options.verbose:
print "Shell exited normally"